<template>
	<view class="content">

		<view class="cellBox" v-for="(item, key) in mylist" :key="key" @click="editinfo(key)">
			<view class='cellLeft'>
				
				
				<view >
					
					
					<text class="texthint">团队名称：</text>
					
					<text class="textcontent">{{item.teamname}}</text>
					
					
				</view>
				
				
				<view >
					
					
					<text class="texthint">商品名称：</text>
					
					<text class="textcontent">{{item.goodsname}}</text>
					
					
				</view>
				
				
				
				<view >
					
					
					<text class="texthint">商品数量：</text>
					
					<text class="textcontent">{{item.goods_num}}</text>
					
					
				</view>
				
		
	
		
	
	
		
	
			</view>
			
		<!-- 	<view class='cell-item-ft'>
				 -->	
				<image class="image"  src='/static/image/compile.png' @click="toEdit(item.id)"></image>
			<!-- </view> -->
		
		</view>
		<view class="address-none" v-if="!mylist || mylist.length==0">
			<view class="address-none-img"  >暂无记录</view>
		</view>
		<view class="button-bottom">

			<view class="bottomButton" @click="toAdd()" >新增复投商品</view>
		</view>
	</view>
</template>

<script>
export default {
    data() {
        return {
			mylist: [] ,// 用户收货地址列表

        }
    },

	onShow () {
		this.userShipList();
	},
    methods: {
		// 获取收货地址列表
		userShipList () {
		
			let userToken = this.$db.get("userToken");
			
			var data = {
		
				token : userToken,
				
			}
		
		console.log(data);
				
		this.$api.userrepeatgoodslist( data, res => {
			if (res.status) {
			
				console.log(res);
			
				
				this.mylist = res.data;
				
				console.log(this.mylist);
				
		
		
			}
		})
		},
		
		editinfo(op){
			
			// console.log();
			
			var info = this.mylist[op];
			
			var show = './addReselectGood?teamid=' + info.team_type 
			 + '&goodid=' + info.goods_id + '&goodnum=' + info.goods_num 
			 + '&id=' + info.id ;
			 
			 if (info.user_ship_data){
				 
				 console.log(info.user_ship_data);
				 
				 this.$db.set('address_user_ship', info.user_ship_data, true);
				 
			 }
			 
			 console.log(show);
			
			this.$common.navigateTo(show);
			
			
		},
		

		//添加
		toAdd() {
			this.$common.navigateTo('./addReselectGood');
		},
		
    }
}
</script>

<style>

.cellBox{
	
	background-color: #FFFFFF;
	
	border-top-width: 1upx;
	
	border-top-color: #eeeeee;
	
	border-top-style: solid;
	
	display: flex;
	
	flex-direction: row;
	
	align-items: center;
	
	
	
	
}


.cellLeft{
	
	height: 100%;
	
	margin-top: 30upx;
	
	margin-bottom: 30upx;
	
	width: 85%;
	
	display: flex;

	flex-direction: column;
	
	
}

.image{
	
	width: 50upx;
	
	height: 50upx;
	
	margin-right: 20upx;
	
	
}




.bottomButton{
	
	line-height: 90upx;
	
	width: 100%;
	
	height: 100%;
	
	text-align: center;
	
	color: #FFFFFF;

	background: #000000;
	
}

.texthint{
	
	color: #444444;
	
	line-height: 50upx;
	
	margin-left: 40upx;
	
	
	
}


.textcontent{
	
	
	color: #000000;
	
	line-height: 50upx;
	
	margin-left: 10upx;
	
	
}

.address-none-img{
	
	position: absolute;
	
	width: 100%;
	
	height: 100%;
	
	color: #999999;
	
	line-height: 800upx;
	
	text-align: center;
	
}





</style>